﻿using System;
using System.Reflection;

namespace Dsl.Ped.Common.Helpers
{
    /// <summary>
    /// Helper class for the <see cref="Type"/> objects
    /// </summary>
    public class TypeHelper
    {
        /// <summary>
        /// Gets the <see cref="Assembly"/> in which the <see cref="Type"/> is defined
        /// </summary>
        /// <param name="type"><see cref="Type"/> which assembly we are interested in</param>
        /// <returns><see cref="Assembly"/> in which the given <see cref="Type"/> is defined, Null if given <see cref="Type"/>
        /// is null</returns>
        public static Assembly GetAssembly(Type type)
        {
            return (type == null) ? null : type.Assembly;
        }
    }
}
